<template>
    <div class="bod">
         <div class="top">
            <img src="../../../assets/personal/images/dingdanchengg.png">
            <p>订单支付成功</p>
         </div>
         <div class="button">
            <p>支付方式:
                <span>{{ordeTYpejs[orderType]}}</span>
            </p>
            <p>订单金额:<span>￥{{orderAmount}}</span></p>
         </div>
         <div class="btn_btn">
             <button @click="href(1)">查看订单</button><button @click="href(2)">返回首页</button>
         </div>
    </div>
</template>
<script>
export default {
    data () {
        return {
            orderid:this.$route.query.id,
            orderAmount:'',
            orderType:'',
            ordeTYpejs:{"1":"现金支付","2":"红包支付","3":"红包支付,现金支付","4":"红包支付，现金支付","5":"现金","6":"红包"}
        }
    },
    mounted () {
            this.paytapy()
    },
    methods:{
       href:function(styleid){
           if(1==styleid){
               this.$router.push({name:'orderdetails',query:{id:this.orderid,type:1}})
           }else{
               this.$router.push({name:'Index'})
           }        
       },
       paytapy(){
            this.$http.get(this.APIURL_PREFIX + '/api/wap/paymentSuccess', { params: { orderId: this.orderid} }).then((response) => {
               this.orderAmount=response.data.data[0].orderAmount/100
               this.orderType=response.data.data[0].orderType
             }).catch(function (err) {
                console.log(err)
            });
       }
    }
}
</script>
<style scoped>
.bod{
    
}
.top{
    width: 142px;
    height: 160px;
    margin: 0 auto;
    padding-top: 40px;
}
.top p{
    padding: 15px;
}
.button{
    width: 180px;
    margin:0 auto;
    text-align: left;
    margin-top: 90px;
}
.button span{
    color: red;
}
.btn_btn{
  padding: 88px 0;
}
.btn_btn button{
    margin: 15px;
    background: red;
    color: white;
    border-radius: 5px;
    width: 133px;
    height: 43px;
}
</style>


